package uestc.lj.midPromotion.greedy;

/**
 * @Author:Crazlee
 * @Date:2021/12/4
 */
public class Code05_Divided3Times {
	public static int getNumber(int left, int right) {
		int result = 0;
		for (int i = left; i <= right; i++) {
			if (divided3(left)) {
				result++;
			}
		}
		return result;
	}

	private static boolean divided3(int number) {
		int sum = 0;
		for (int i = 1; i <= number; i++) {
			sum += i;
		}
		return sum % 3 == 0;
	}
}
